home *** CD-ROM | disk | FTP | other *** search
/ stazsoftware.com / www.stazsoftware.com.tar / www.stazsoftware.com / futurebasic / sample-code / functionCounter.sit / fnCounter next >
Text File  |  2001-06-15  |  835b  |  43 lines

  1. local fn test1
  2. end fn
  3.  
  4. /*
  5. local fn test2
  6. end fn
  7. */
  8.  
  9. dim h           as handle
  10. dim currResFile as short
  11. dim resFile     as short
  12. window 1, "STAZ 2000 resource"
  13. currResFile = fn CurResFile
  14. print "currResFile = " currResFile
  15. h = fn Get1Resource( _"STAZ", 2000 )
  16.  
  17. long if h == 0
  18. print  "Resource not found in app's resources"
  19. h = fn GetResource( _"STAZ", 2000 )
  20. long if h == 0
  21. print "Resource not found anywhere"
  22. stop
  23. end if
  24. end if
  25. print
  26. resFile = fn HomeResFile( h )
  27. select resFile
  28. case 0: print "In System file"
  29. case 1: print "In ROM"
  30. case -1: print "Not a resource"
  31. case else: print "In res file " resFile
  32. end select
  33.  
  34. print "Contents (16 bytes):"
  35. print hex$( [[h]] ), hex$( [[h]+4] ),
  36. print  hex$( [[h]+8] ),  hex$( [[h]+12] )
  37.  
  38. // #FNs is coded away like this:
  39. print "Number of local FNs = "  {[h] + 2} -  [[h] + 8]
  40. do
  41. until fn button
  42.  
  43.